{extend name="public/base" /}
{block name="title"}
<title>{:confv('title')}</title>
<meta name="keywords" content="{:confv('keywords')}">
<meta name="description" content="{:confv('description')}">
{/block}
{block name="head"}
<link href="__ROOT__/home/AmazeUI-2.4.2/assets/css/admin.css" rel="stylesheet" type="text/css">
<link href="__ROOT__/home/AmazeUI-2.4.2/assets/css/amazeui.css" rel="stylesheet" type="text/css">

<link href="__ROOT__/home/css/personal.css" rel="stylesheet" type="text/css">
<link href="__ROOT__/home/css/orstyle.css" rel="stylesheet" type="text/css">

<script src="__ROOT__/home/AmazeUI-2.4.2/assets/js/jquery.min.js"></script>
<script src="__ROOT__/home/AmazeUI-2.4.2/assets/js/amazeui.js"></script>
<script src="__ROOT__/home/js/layer/layer.js"></script>	
{/block}
{block name="body"}
 <div class="nav-table">
		   <div class="long-title"><span class="all-goods">全部分类</span></div>
		   <div class="nav-cont">
				<ul>
					{foreach $cates as $vo}
		                <li class="qc"><a href="{:url('/'.$vo['id'])}">{$vo.typename}</a></li>
				    {/foreach}
				</ul>
			   
			</div>
			</div>
			<b class="line"></b>
		<div class="center">
			<div class="col-main">
				<div class="main-wrap">

					<div class="user-order">

						<!--标题 -->
						<div class="am-cf am-padding">
							<div class="am-fl am-cf"><strong class="am-text-danger am-text-lg">订单管理</strong> / <small>Order</small></div>
						</div>
						<hr/>

						<div class="am-tabs am-tabs-d2 am-margin" data-am-tabs>

							<ul class="am-avg-sm-5 am-tabs-nav am-nav am-nav-tabs">
								<li class="am-active"><a href="#tab1">所有订单</a></li>
								<li><a href="#tab2">待付款</a></li>
								<li><a href="#tab3">已付款</a></li>
							</ul>

							<div class="am-tabs-bd">
								<div class="am-tab-panel am-fade am-in am-active" id="tab1">
									<div class="order-top">
										<div class="th th-item">
											<td class="td-inner">商品</td>
										</div>
										<div class="th th-price">
											<td class="td-inner">单价</td>
										</div>
										<div class="th th-number">
											<td class="td-inner">数量</td>
										</div>
										<div class="th th-operation">
											<td class="td-inner">详情</td>
										</div>
										<div class="th th-amount">
											<td class="td-inner">合计</td>
										</div>
										<div class="th th-status">
											<td class="td-inner">交易状态</td>
										</div>
										<div class="th th-change">
											<td class="td-inner">交易操作</td>
										</div>
									</div>

									<div class="order-main">
										<div class="order-list">
											
											{foreach $orders as $vo}
											<!--交易成功-->
											<div class="order-status5">
												<div class="order-title">
													<div class="dd-num">订单编号：<a href="javascript:;">{$vo.order_id}</a></div>
													<span>成交时间：{:date('Y-m-d',$vo['create_time'])}</span>
													<!--    <em>店铺：小桔灯</em>-->
												</div>
												<div class="order-content">
													<div class="order-left">

														<ul class="item-list">
															<li class="td td-item">
																<div class="item-pic">
																	<a href="#" class="J_MakePoint">
																		<img src="__ROOT__/home/images/kouhong.jpg_80x80.jpg" class="itempic J_ItemImg">
																	</a>
																</div>
																<div class="item-info">
																	<div class="item-basic-info">
																		<a href="#">
																			<p>{$vo.title}</p>
																			<p class="info-little">
																			{$vo.description}
																			</p>
																		</a>
																	</div>
																</div>
															</li>
															<li class="td td-price">
																<div class="item-price">
																	{$vo.price}
																</div>
															</li>
															<li class="td td-number">
																<div class="item-number">
																	<span>×</span>{$vo.number}
																</div>
															</li>
															<li class="td td-operation">
																<div class="item-operation">
																  操作师：{$vo.operation}<br/>
																  助理师: {$vo.assistant}
																</div>
															</li>
														</ul>
													</div>
													<div class="order-right">
														<li class="td td-amount">
															<div class="item-amount">
																合计：{$vo.total}
															</div>
														</li>
														<div class="move-right">
															<li class="td td-status">
																<div class="item-status">
																	<p class="Mystatus"> 
																	{$vo['status']==1 ? '已支付' : '未支付'}
																	</p>
																</div>
															</li>
															<li class="td td-change">
															    {if condition="$vo['status'] eq 0"}
															    <div class="am-btn am-btn-danger anniu delete" data-value="{$vo.id}">
																	删除订单</div>
															    {else /}
															    <div class="am-btn am-btn-danger anniu">
																	交易关闭</div>
															    {/if}
															</li>
														</div>
													</div>
												</div>
											</div>
											{/foreach}
										</div>

									</div>

								</div>
								<div class="am-tab-panel am-fade" id="tab2">

									<div class="order-top">
										<div class="th th-item">
											<td class="td-inner">商品</td>
										</div>
										<div class="th th-price">
											<td class="td-inner">单价</td>
										</div>
										<div class="th th-number">
											<td class="td-inner">数量</td>
										</div>
										<div class="th th-operation">
											<td class="td-inner">商品操作</td>
										</div>
										<div class="th th-amount">
											<td class="td-inner">合计</td>
										</div>
										<div class="th th-status">
											<td class="td-inner">交易状态</td>
										</div>
										<div class="th th-change">
											<td class="td-inner">交易操作</td>
										</div>
									</div>
                         
                                    <!-- 待付款 -->
									<div class="order-main">
                                        {foreach $orders as $vo}
										{if condition="$vo['status'] eq 0"}
										<div class="order-list">
											<div class="order-status1">
												<div class="order-title">
													<div class="dd-num">订单编号：<a href="javascript:;">{$vo.order_id}</a></div>
													<span>成交时间：{:date('Y-m-d',$vo['create_time'])}</span>
													<!--    <em>店铺：小桔灯</em>-->
												</div>
												<div class="order-content">
													<div class="order-left">
														<ul class="item-list">
															<li class="td td-item">
																<div class="item-pic">
																	<a href="#" class="J_MakePoint">
																		<img src="__ROOT__/home/images/kouhong.jpg_80x80.jpg" class="itempic J_ItemImg">
																	</a>
																</div>
																<div class="item-info">
																	<div class="item-basic-info">
																		<a href="#">
																			<p>{$vo.title}</p>
																			<p class="info-little">{$vo.description}</p>
																		</a>
																	</div>
																</div>
															</li>
															<li class="td td-price">
																<div class="item-price">
																	{$vo.price}
																</div>
															</li>
															<li class="td td-number">
																<div class="item-number">
																	<span>×</span>{$vo.number}
																</div>
															</li>
															<li class="td td-operation">
																<div class="item-operation">

																</div>
															</li>
														</ul>
													</div>
													<div class="order-right">
														<li class="td td-amount">
															<div class="item-amount">
																合计：{$vo.total}
															</div>
														</li>
														<div class="move-right">
															<li class="td td-status">
																<div class="item-status">
																	<p class="Mystatus">未支付</p>

																</div>
															</li>
															<li class="td td-change">
																<a href="javascript:;">
																<div class="am-btn am-btn-danger anniu topay" data-value="{$vo.id}">
																	一键支付</div></a>
															</li>
														</div>
													</div>

												</div>
											</div>
										</div>
                                        {/if}
										{/foreach}
									</div>
								</div>

								<!-- 已付款 -->
								<div class="am-tab-panel am-fade" id="tab3">
									<div class="order-top">
										<div class="th th-item">
											<td class="td-inner">商品</td>
										</div>
										<div class="th th-price">
											<td class="td-inner">单价</td>
										</div>
										<div class="th th-number">
											<td class="td-inner">数量</td>
										</div>
										<div class="th th-operation">
											<td class="td-inner">商品操作</td>
										</div>
										<div class="th th-amount">
											<td class="td-inner">合计</td>
										</div>
										<div class="th th-status">
											<td class="td-inner">交易状态</td>
										</div>
										<div class="th th-change">
											<td class="td-inner">交易操作</td>
										</div>
									</div>

									<div class="order-main">
									    {foreach $orders as $vo}
										{if condition="$vo['status'] eq 1"}
										<div class="order-list">
											<div class="order-status2">
												<div class="order-title">
													<div class="dd-num">订单编号：<a href="javascript:;">{$vo.order_id}</a></div>
													<span>成交时间：{:date('Y-m-d',$vo['create_time'])}</span>
													<!--    <em>店铺：小桔灯</em>-->
												</div>
												<div class="order-content">
													<div class="order-left">
														<ul class="item-list">
															<li class="td td-item">
																<div class="item-pic">
																	<a href="#" class="J_MakePoint">
																		<img src="__ROOT__/home/images/kouhong.jpg_80x80.jpg" class="itempic J_ItemImg">
																	</a>
																</div>
																<div class="item-info">
																	<div class="item-basic-info">
																		<a href="#">
																			<p>{$vo.title}</p>
																			<p class="info-little">{$vo.description}</p>
																		</a>
																	</div>
																</div>
															</li>
															<li class="td td-price">
																<div class="item-price">
																	{$vo.price}
																</div>
															</li>
															<li class="td td-number">
																<div class="item-number">
																	<span>×</span>{$vo.number}
																</div>
															</li>
															<li class="td td-operation">
																<div class="item-operation">
																	<!-- <a href="refund.html">退款</a> -->
																</div>
															</li>
														</ul>

													</div>
													<div class="order-right">
														<li class="td td-amount">
															<div class="item-amount">
																合计：{$vo.total}
															</div>
														</li>
														<div class="move-right">
															<li class="td td-status">
																<div class="item-status">
																	<p class="Mystatus">已付款</p>
																</div>
															</li>
															<li class="td td-change">
																<div class="am-btn am-btn-danger anniu">
																	交易关闭</div>
															</li>
														</div>
													</div>
												</div>
											</div>
										</div>
										{/if}
										{/foreach}
									</div>
								</div>
								
								
							</div>

						</div>
					</div>
				</div>
				<!--底部-->
				{block name="foot"}{include file="public/footer" /}{/block}
			</div>
			<aside class="menu">
				<ul>
					<li class="person active">
						<a href="index.html"><i class="am-icon-user"></i>个人中心</a>
					</li>
					<li class="person">
						<ul>
							<li> <a href="{:url('/member')}">个人信息</a></li>
							<li> <a href="{:url('/myorder')}">订单详情</a></li>
							<li> <a href="{:url('/myscore')}">我的积分</a></li>
							<li> <a href="{:url('/mylong')}">消费详情</a></li>
							<li> <a href="{:url('/subordinate')}">会员信息</a></li>
						</ul>
					</li>
				</ul>

			</aside>
		</div>
<script type="text/javascript">
$('.delete').click(function() {
	var id = $(this).attr('data-value');
	$.post('{:url('/del')}',{id:id},function(data){
		if (data.status==1) {
			layer.msg(data.info);
			window.setTimeout(function(){
				window.location.reload();
			},1000)
		}else{
            layer.msg(data.info);
		}
	})
})

$('.topay').click(function() {
	var id = $(this).attr('data-value');
	window.location.href= '/order/'+id+'.html';
})
</script>
{/block}